package com.yanmaohu.yulia.statement;

import com.yanmaohu.yulia.bean.DropBehavior;
import com.yanmaohu.yulia.bean.GranteeList;
import com.yanmaohu.yulia.bean.Grantor;
import com.yanmaohu.yulia.bean.Privileges;

/**
 * @author Bright Lee
 */
public final class RevokePrivilegeStatement implements RevokeStatement {

    private int beginIndex;
    private int endIndex;
    private boolean grantOptionFor;
    private boolean hierarchyOptionFor;
    private Privileges privileges;
    private GranteeList granteeList;
    private Grantor grantor;
    private DropBehavior dropBehavior;

    public RevokePrivilegeStatement(int beginIndex,
                                    boolean grantOptionFor,
                                    boolean hierarchyOptionFor,
                                    Privileges privileges,
                                    GranteeList granteeList,
                                    Grantor grantor,
                                    DropBehavior dropBehavior) {
        this.beginIndex = beginIndex;
        this.endIndex = dropBehavior.getEndIndex();
        this.grantOptionFor = grantOptionFor;
        this.hierarchyOptionFor = hierarchyOptionFor;
        this.privileges = privileges;
        this.granteeList = granteeList;
        this.grantor = grantor;
        this.dropBehavior = dropBehavior;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public boolean isGrantOptionFor() {
        return grantOptionFor;
    }

    public boolean isHierarchyOptionFor() {
        return hierarchyOptionFor;
    }

    public Privileges getPrivileges() {
        return privileges;
    }

    public GranteeList getGranteeList() {
        return granteeList;
    }

    public Grantor getGrantor() {
        return grantor;
    }

    public DropBehavior getDropBehavior() {
        return dropBehavior;
    }

}
